{-# LANGUAGE OverloadedStrings #-}

import Util
import Text.LaTeX
import Text.LaTeX.Base.Class
import Text.LaTeX.Base.Syntax
import Text.LaTeX.Packages.Graphicx
import Text.LaTeX.Packages.Geometry

main :: IO ()
main = printdoc doc

doc :: Monad m => LaTeXT_ m
doc = do
    mapM_ (\y -> mapM (\z -> x y (z + y)) [0 :: Double, pi / 6 .. pi * 11 / 6]) [0.3 :: Double, 0.325 .. 1.5]
    mapM_ (\y -> mapM (\z -> x y (z - y)) [0 :: Double, (-pi) / 6 .. (-pi) * 11 / 6]) [0.3 :: Double, 0.325 .. 1.5]
    textblock' (vw 0.5) (vh 0.5) ("Shadows" <> lnbk <> "by natalia n")

x :: LaTeXC l => Double -> Double -> l
x r t = textblock' (vw $ 0.5 + (cos t) * r) (vw $ sqrt 2 / 2 + (sin t) * r) $ rotatebox' (t * (-180) / pi - 90) $ fontsize (vw $ r * 0.20) (vw $ r * 0.25) "shadows"
